package com.lock.redsession.lockredsession.bean;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity(name = "product")   // 指定自动生成表的名称为当前类的类名
@Data
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler", "fieldHandler"})
public class Product {

    @Id  // 指定当前属性为生成表的主键
    @GeneratedValue(strategy = GenerationType.IDENTITY)   // 主键自动递增
    private int productId;

    private String productName;

    private int productStock;

    private int productPrice;
}
